package codediff.parse.report.enumeration;

import com.google.common.collect.ImmutableList;

import java.util.List;

/**
 * 考虑移除 COMPLEXITY 和 CLASS 度量
 * xml里并没有 COMPLEXITY 具体信息，新代码无法计算出 COMPLEXITY
 */
public enum CounterType {
    INSTRUCTION, BRANCH, LINE, COMPLEXITY, METHOD, CLASS,
    NEW_INSTRUCTION, NEW_BRANCH, NEW_LINE, NEW_COMPLEXITY, NEW_METHOD, NEW_CLASS;


    public static final List<CounterType> NEW_COUNTER_TYPES = ImmutableList.of(NEW_INSTRUCTION, NEW_BRANCH, NEW_LINE,
            NEW_COMPLEXITY, NEW_METHOD, NEW_CLASS);

    public static boolean isNewCounterType(CounterType type) {
        return NEW_COUNTER_TYPES.contains(type);
    }
}